<script setup lang="ts">
// 引入Element Plus图标（与Login.vue保持一致的图标库）
import { HomeFilled } from '@element-plus/icons-vue';
</script>

<template>
  <div class="not-found-page">
    <!-- 复用Login.vue的背景装饰（渐变+波浪动画） -->
    <div class="bg-decoration">
      <div class="wave"></div>
      <div class="wave"></div>
      <div class="wave"></div>
    </div>

    <!-- 404内容容器：居中显示+玻璃磨砂效果 -->
    <div class="not-found-container">
      <div class="not-found-content">
        <!-- 醒目404文字 -->
        <div class="not-found-code">404</div>
        <!-- 提示文字 -->
        <div class="not-found-text">Not Found</div>
        <div class="not-found-desc">抱歉，您访问的页面不存在或已被移除</div>

        <!-- 返回首页按钮（风格与Login.vue按钮统一） -->
        <a href="/" class="back-home-btn">
          <el-icon class="back-icon"><HomeFilled /></el-icon>
          返回首页
        </a>
      </div>
    </div>
  </div>
</template>

<style scoped>
/* 根容器：复用Login.vue的基础布局样式 */
.not-found-page {
  font-size: clamp(14px, 1.5vw + 0.5rem, 16px);
  min-height: 100vh;
  background-color: #0a0a0a; /* 与Login.vue深色背景统一 */
  position: relative;
  overflow: hidden;
}

/* 完全复用Login.vue的动态背景样式（渐变+波浪） */
.bg-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(315deg, rgba(101,0,94,1) 3%, rgba(60,132,206,1) 38%, rgba(48,238,226,1) 68%, rgb(128, 25, 255) 98%);
  animation: gradient 15s ease infinite;
  background-size: 400% 400%;
  background-attachment: fixed;
  z-index: 0;
}

@keyframes gradient {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  100% {
    background-position: 0% 0%;
  }
}

.wave {
  background: rgb(255 255 255 / 25%);
  border-radius: 1000% 1000% 0 0;
  position: absolute;
  width: 200%;
  height: 12em;
  animation: wave 10s -3s linear infinite;
  transform: translate3d(0, 0, 0);
  opacity: 0.8;
  bottom: 0;
  left: 0;
  z-index: -1;
}

.wave:nth-of-type(2) {
  bottom: -1.25em;
  animation: wave 18s linear reverse infinite;
  opacity: 0.8;
}

.wave:nth-of-type(3) {
  bottom: -2.5em;
  animation: wave 20s -1s reverse infinite;
  opacity: 0.9;
}

@keyframes wave {
  2% {
    transform: translateX(1px);
  }
  25% {
    transform: translateX(-25%);
  }
  50% {
    transform: translateX(-50%);
  }
  75% {
    transform: translateX(-25%);
  }
  100% {
    transform: translateX(1px);
  }
}

/* 404容器：全屏居中 */
.not-found-container {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

/* 玻璃磨砂背景：半透明+模糊+边框 */
.not-found-content {
  width: 100%;
  max-width: 500px;
  padding: clamp(2rem, 5vw, 3rem);
  text-align: center;
  background: rgba(255, 255, 255, 0.1); /* 半透明白色背景 */
  backdrop-filter: blur(12px); /* 玻璃磨砂核心：背景模糊 */
  -webkit-backdrop-filter: blur(12px); /* 兼容Safari */
  border-radius: clamp(0.8rem, 2vw, 1.2rem); /* 与Login.vue卡片圆角统一 */
  border: 1px solid rgba(255, 255, 255, 0.2); /* 细边框增强层次感 */
  box-shadow: 0 clamp(0.5rem, 2vw, 1.5rem) clamp(1rem, 3vw, 3rem) rgba(0, 0, 0, 0.15);
}

/* 404文字：超大号+渐变色彩（醒目效果） */
.not-found-code {
  font-size: clamp(6rem, 20vw, 10rem);
  font-weight: 900;
  margin: 0 0 clamp(1rem, 3vw, 1.5rem);
  background: rgb(255, 255, 255);
  //background: linear-gradient(90deg, #e3ffbe, #c4adfd, #ffabd0); /* 渐变文字 */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

/* 提示文字样式 */
.not-found-text {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 600;
  color: #fff;
  margin: 0 0 clamp(0.5rem, 2vw, 1rem);
}

.not-found-desc {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 clamp(2rem, 5vw, 3rem);
  line-height: 1.6;
}

/* 返回首页按钮：复用Login.vue按钮风格 */
.back-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 280px;
  height: clamp(2.5rem, 6vw, 3.125rem);
  background-color: #4299e1;
  color: #fff;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 500;
  border-radius: clamp(0.3rem, 1vw, 0.5rem);
  transition: all 0.2s ease;
  text-decoration: none;
}

.back-home-btn:hover {
  background-color: #3182ce;
  transform: translateY(-0.125rem);
  color: #fff;
}

.back-home-btn:active {
  transform: translateY(0);
}

.back-icon {
  margin-right: 8px;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

/* 响应式适配：小屏幕优化 */
@media (max-width: 576px) {
  .not-found-content {
    padding: clamp(1.5rem, 4vw, 2rem);
    margin: 0 1rem;
  }

  .not-found-code {
    font-size: clamp(4rem, 18vw, 8rem);
  }
}
</style>